const { DataTypes } = require('sequelize');
const sequelize = require('../config/database');

const CustomInfo = sequelize.define('custom_info', {
  custom_id: {
    type: DataTypes.STRING(32),
    allowNull: false,
    primaryKey: true,
    comment: '定制编号'
  },
  product_id: {
    type: DataTypes.STRING(32),
    allowNull: false,
    comment: '商品编号'
  },
  size: {
    type: DataTypes.ENUM('XS', 'S', 'M', 'L', 'XL', 'XXL'),
    allowNull: false,
    comment: '尺码'
  },
  style_info: {
    type: DataTypes.JSON,
    allowNull: false,
    comment: '款式信息'
  },
  custom_requirements: {
    type: DataTypes.TEXT,
    comment: '定制要求'
  },
  user_id: {
    type: DataTypes.STRING(32),
    allowNull: false,
    comment: '用户编号'
  }
}, {
  tableName: 'custom_info',
  timestamps: true,
  createdAt: 'create_time',
  updatedAt: 'update_time'
});

module.exports = CustomInfo; 